# -*- coding:utf-8 -*-
# @Author:🎈RedBalloon
# @Time:2022/10/2-16:02
# @File:16-requests的使用2.py
import requests
from fake_useragent import UserAgent

# requests的GET请求使用

url = "https://baidu.com/s?"
params = {
    "wd": "英雄联盟",
}
headers = {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
    # "Host": "www.baidu.com",
    "User-Agent": UserAgent().random,
}
response = requests.get(url, headers=headers, params=params)
response.encoding = 'utf-8'
print(response.text)

